package com.taskinception.utils;

import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;

import com.taskinception.R;

public class TaskListCache {

    private View base;
    private ImageView shareImage;
    private TextView title;
    private CheckBox checkbox;
    private TextView progress;

    public TaskListCache(View base) {
	this.base = base;
    }

    public View getBase() {
	return base;
    }

    public ImageView getShareImage() {
	if (shareImage == null) {
	    shareImage = (ImageView) base.findViewById(R.id.task_share_image);
	}
	return shareImage;
    }

    public TextView getTitle() {
	if (title == null) {
	    title = (TextView) base.findViewById(R.id.task_title);
	}
	return title;
    }

    public CheckBox getCheckbox() {
	if (checkbox == null) {
	    checkbox = (CheckBox) base.findViewById(R.id.task_checked);
	}
	return checkbox;
    }

    public TextView getProgress() {
	if (progress == null) {
	    progress = (TextView) base.findViewById(R.id.task_progress);
	}
	return progress;
    }

}
